class Count < ActiveRecord::Base
  belongs_to :countable, :polymorphic => true

  def self.find_counts_for_countable(countable_str, countable_id)
    find(:first,
      :conditions => ["countable_type = ? and countable_id = ?", countable_str, countable_id]
    )
  end

  def self.find_countable(countable_str, countable_id)
    countable_str.constantize.find(countable_id)
  end
end